﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Script : MonoBehaviour
{
    public Transform Sun;
    public Transform Earth;
    public Transform Moon;
    public Transform Mercury;
    public Transform Venus;
    public Transform Mars;
    public Transform Jupiter;
    public Transform Saturn;
    public Transform Uranus;
    public Transform Neptune;
    // Start is called before the first frame update
    void Start()
    {
        Sun.position = Vector3.zero;
        Earth.position = new Vector3(15, 0, 0);
        Moon.position = new Vector3(18, 0, 0);
        Mercury.position = new Vector3(6, 0, 0);
        Venus.position = new Vector3(10, 0, 0);
        Mars.position = new Vector3(22, 0, 0);
        Jupiter.position = new Vector3(28, 0, 0);
        Saturn.position = new Vector3(34, 0, 0);
        Uranus.position = new Vector3(38, 0, 0);
        Neptune.position = new Vector3(46, 0, 0);
    }

    // Update is called once per frame
    void Update()
    {
        Earth.RotateAround(Sun.position, Vector3.up, 10 * Time.deltaTime);
        Earth.Rotate(Vector3.up, 30 * Time.deltaTime);
        Mercury.RotateAround(Sun.position,new Vector3(1, 1, 0), 30 * Time.deltaTime);
        Mercury.Rotate(new Vector3(1, 1, 0), 600 * Time.deltaTime);
        Venus.RotateAround(Sun.position, new Vector3(1, 1, 0.5f), 20 * Time.deltaTime);
        Venus.Rotate(new Vector3(1, 1, 0.5f), 400 * Time.deltaTime);
        Mars.RotateAround(Sun.position, new Vector3(1, 0, 0.5f), 8 * Time.deltaTime);
        Mars.Rotate(new Vector3(1, 0, 0.5f), 330 * Time.deltaTime);
        Jupiter.RotateAround(Sun.position, new Vector3(1, 0, 1), 5 * Time.deltaTime);
        Jupiter.Rotate(new Vector3(1, 0, 1), 280 * Time.deltaTime);
        Saturn.RotateAround(Sun.position, new Vector3(1, 2, 1), 4.5f * Time.deltaTime);
        Saturn.Rotate(new Vector3(1, 2, 1), 250 * Time.deltaTime);
        Uranus.RotateAround(Sun.position, new Vector3(1, 3, 1), 3.5f * Time.deltaTime);
        Uranus.Rotate(new Vector3(1, 3, 1), 200 * Time.deltaTime);
        Neptune.RotateAround(Sun.position, new Vector3(1, 7, 1), 2.5f * Time.deltaTime);
        Neptune.Rotate(new Vector3(1, 7, 1), 100 * Time.deltaTime);
        Moon.RotateAround(Earth.position, Vector3.up, 359 * Time.deltaTime);
    }
}
